<template>
  <div>
    <el-form ref="form" :model="model" status-icon label-width="100px">
      <template v-for="(item, key) in model">
        <el-form-item :key="key" :prop="key" :label="$language.local(key)">
          <xy-input v-model="model[key]"></xy-input>
        </el-form-item>
      </template>
    </el-form>
    <div class="form-footer">
      <el-button @click="onSubmit('form')"></el-button>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    model: Object,
    api: Object,
  },
  data() {
    return {};
  },
  methods: {
    async onSubmi(formName) {
      let valided = this.$refs[formName].validate().catch();
      console.log(valided);
    },
  },
};
</script>

<style></style>
